<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>Hexo</title>

  <!-- keywords -->
  

  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta property="og:type" content="website">
<meta property="og:title" content="Hexo">
<meta property="og:url" content="https://boz03.gitee.io/boz/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:locale" content="zh_CN">
<meta property="article:author" content="boz03">
<meta name="twitter:card" content="summary">
  
    <link rel="alternative" href="/atom.xml" title="Hexo" type="application/atom+xml">
  
  
    <link rel="icon" href="/img/favicon.ico">
  
  
<link rel="stylesheet" href="/boz/css/style.css">

  
  

  
<script src="//cdn.bootcss.com/require.js/2.3.2/require.min.js"></script>

  
<script src="//cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>


  
<meta name="generator" content="Hexo 6.3.0"></head>
<body>
  <div id="container">
    <div id="particles-js"></div>
    <div class="left-col">
    <div class="overlay"></div>
<div class="intrude-less">
	<header id="header" class="inner">
		<a href="/" class="profilepic">
			
				<img lazy-src="" class="js-avatar">
			
		</a>

		<hgroup>
			<h1 class="header-author"><a href="/">boz03</a></h1>
		</hgroup>

		

		<div class="switch-area">
			<div class="switch-wrap">
				<section class="switch-part switch-part1">
					<nav class="header-menu">
						<ul>
						
							<li><a href="/boz/">Home</a></li>
				        
							<li><a href="/boz/archives">Archives</a></li>
				        
						</ul>
					</nav>
					<nav class="half-header-menu">
						<a class="hide">Home</a>
						<a>Tags</a>
						<a>Links</a>
						<a>About</a>
					</nav>
					<nav class="header-nav">
						<div class="social">
							
						</div>
						<!-- music -->
						
					</nav>
				</section>
				
				
				<section class="switch-part switch-part2">
					<div class="widget tagcloud" id="js-tagcloud">
						
					</div>
				</section>
				
				
				
				<section class="switch-part switch-part3">
					<div id="js-friends">
					
			          <a target="_blank" class="main-nav-link switch-friends-link" href="https://github.com/">github</a>
			        
			        </div>
				</section>
				

				
				
				<section class="switch-part switch-part4">
				
					<div id="js-aboutme">I&#39;m a developer.</div>
				</section>
				
			</div>
		</div>
	</header>				
</div>
    </div>
    <div class="mid-col">
      <nav id="mobile-nav">
  	<div class="overlay">
  		<div class="slider-trigger"></div>
  		<h1 class="header-author js-mobile-header hide"></h1>
  	</div>
	<div class="intrude-less">
		<header id="header" class="inner">
			<div class="profilepic">
				<img lazy-src="" class="js-avatar">
			</div>
			<hgroup>
			  <h1 class="header-author"></h1>
			</hgroup>
			
			<nav class="header-menu">
				<ul>
				
					<li><a href="/boz/">Home</a></li>
		        
					<li><a href="/boz/archives">Archives</a></li>
		        
		        <div class="clearfix"></div>
				</ul>
			</nav>
			<nav class="header-nav">
				<div class="social">
					
				</div>
			</nav>
		</header>				
	</div>
</nav>
      <div class="body-wrap">
  
    <article id="post-cefsharp" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/boz/2023/03/27/cefsharp/" class="article-date">
  	<time datetime="2023-03-27T09:38:59.000Z" itemprop="datePublished">2023-03-27</time>
</a>
    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy" />
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/boz/2023/03/27/cefsharp/">
        CefSharp使用
        
      </a>
    </h1>
  

      </header>
      
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="多窗口cookie隔离"><a href="#多窗口cookie隔离" class="headerlink" title="多窗口cookie隔离"></a>多窗口cookie隔离</h2><p>这个问题困扰了我一整天,搜遍百度,CSDN,人都搜麻了,没有找到有效的方法.最后查看了CefSharp的官方文档,才找到问题所在.<br>首先得设置CefSettings.RootCachePath.代码如下:</p>
<figure class="highlight csharp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">CefSettings cfsettings = <span class="keyword">new</span> CefSettings();</span><br><span class="line">cfsettings.RootCachePath = Application.StartupPath + <span class="string">$@&quot;\Cache\&quot;</span>;</span><br><span class="line">cfsettings.PersistSessionCookies = <span class="literal">true</span>;</span><br><span class="line">Cef.Initialize(cfsettings);</span><br></pre></td></tr></table></figure>
<p>RootCachePath如果不设置的话,浏览器开启的是隐身模式,就是说操作内容可能会保存但是不能保存登录状态,就算设置了单独的缓存文件夹也没有用.<br>然后是Cef.Initialize()这个只能在浏览器初始化之前调用,且只能调用一次.<br>这些设置完成之后,就可以开始设置不同的缓存路径来隔离多浏览器.代码如下:</p>
<figure class="highlight csharp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> requestContext = RequestContext</span><br><span class="line">.Configure()</span><br><span class="line">.WithProxyServer(proxyserver)</span><br><span class="line">.WithCachePath(Path.Combine(Application.StartupPath, <span class="string">&quot;Cache\\&quot;</span> + path))</span><br><span class="line">.Create();</span><br><span class="line">ChromiumWebBrowser chromiumWebBrowser1 = <span class="keyword">new</span> ChromiumWebBrowser()</span><br><span class="line">chromiumWebBrowser1.RequestContext = requestContext;</span><br></pre></td></tr></table></figure>
<p>这里多窗口的缓存路径得是RootCachePath的子路径.如果放在这个路径外会怎么样,我没有去尝试.<br>然后关于代理的设置,一般来说代理都是一个ip加端口,http的可以直接传进WithProxyServer(),也可以把ip和端口分开传入,端口需要是int类型的.https和socks5方式的我没有试过,所以不写.至于需要账号密码的,cefsharp的官方有简单案例.</p>

      
    </div>
    
    <div class="article-info article-info-index">
      
      
      

      
      <div class="clearfix"></div>
    </div>
      
    
  </div>
  
</article>







  
    <article id="post-hello" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/boz/2023/03/27/hello/" class="article-date">
  	<time datetime="2023-03-27T08:42:23.000Z" itemprop="datePublished">2023-03-27</time>
</a>
    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy" />
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/boz/2023/03/27/hello/">
        一些Api
        
      </a>
    </h1>
  

      </header>
      
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="IP地址查询api"><a href="#IP地址查询api" class="headerlink" title="IP地址查询api"></a>IP地址查询api</h2><ol>
<li><a target="_blank" rel="noopener" href="https://ip.useragentinfo.com/json">https://ip.useragentinfo.com/json</a> <ul>
<li><a target="_blank" rel="noopener" href="https://ip.useragentinfo.com/json">https://ip.useragentinfo.com/json</a> 查询当前</li>
<li><a target="_blank" rel="noopener" href="https://ip.useragentinfo.com/json?ip=">https://ip.useragentinfo.com/json?ip=</a> 查询指定ip <figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="punctuation">&#123;</span><span class="attr">&quot;country&quot;</span><span class="punctuation">:</span> <span class="string">&quot;中国&quot;</span><span class="punctuation">,</span> <span class="attr">&quot;short_name&quot;</span><span class="punctuation">:</span> <span class="string">&quot;CN&quot;</span><span class="punctuation">,</span> <span class="attr">&quot;province&quot;</span><span class="punctuation">:</span> <span class="string">&quot;广东省&quot;</span><span class="punctuation">,</span> <span class="attr">&quot;city&quot;</span><span class="punctuation">:</span> <span class="string">&quot;&quot;</span><span class="punctuation">,</span> <span class="attr">&quot;area&quot;</span><span class="punctuation">:</span> <span class="string">&quot;&quot;</span><span class="punctuation">,</span> <span class="attr">&quot;isp&quot;</span><span class="punctuation">:</span> <span class="string">&quot;移动&quot;</span><span class="punctuation">,</span> <span class="attr">&quot;net&quot;</span><span class="punctuation">:</span> <span class="string">&quot;移动网络&quot;</span><span class="punctuation">,</span> <span class="attr">&quot;ip&quot;</span><span class="punctuation">:</span> <span class="string">&quot;117.136.12.79&quot;</span><span class="punctuation">,</span> <span class="attr">&quot;code&quot;</span><span class="punctuation">:</span> <span class="number">200</span><span class="punctuation">,</span> <span class="attr">&quot;desc&quot;</span><span class="punctuation">:</span> <span class="string">&quot;success&quot;</span><span class="punctuation">&#125;</span></span><br></pre></td></tr></table></figure></li>
</ul>
</li>
<li><a target="_blank" rel="noopener" href="https://api.vore.top/api/IPdata">https://api.vore.top/api/IPdata</a> 区分ipv4和ipv6<ul>
<li><a target="_blank" rel="noopener" href="https://api.vore.top/api/IPdata">https://api.vore.top/api/IPdata</a> 查询当前</li>
<li><a target="_blank" rel="noopener" href="https://api.vore.top/api/IPdata?ip=">https://api.vore.top/api/IPdata?ip=</a> 查询指定ip <figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><span class="line"><span class="punctuation">&#123;</span></span><br><span class="line"><span class="attr">&quot;code&quot;</span><span class="punctuation">:</span> <span class="number">200</span><span class="punctuation">,</span></span><br><span class="line"><span class="attr">&quot;msg&quot;</span><span class="punctuation">:</span> <span class="string">&quot;SUCCESS&quot;</span><span class="punctuation">,</span></span><br><span class="line"><span class="attr">&quot;ipinfo&quot;</span><span class="punctuation">:</span> <span class="punctuation">&#123;</span></span><br><span class="line">    <span class="attr">&quot;type&quot;</span><span class="punctuation">:</span> <span class="string">&quot;ipv4&quot;</span><span class="punctuation">,</span></span><br><span class="line">    <span class="attr">&quot;text&quot;</span><span class="punctuation">:</span> <span class="string">&quot;117.136.12.79&quot;</span><span class="punctuation">,</span></span><br><span class="line">    <span class="attr">&quot;cnip&quot;</span><span class="punctuation">:</span> <span class="literal"><span class="keyword">true</span></span></span><br><span class="line"><span class="punctuation">&#125;</span><span class="punctuation">,</span></span><br><span class="line"><span class="attr">&quot;ipdata&quot;</span><span class="punctuation">:</span> <span class="punctuation">&#123;</span></span><br><span class="line">    <span class="attr">&quot;info1&quot;</span><span class="punctuation">:</span> <span class="string">&quot;广东省&quot;</span><span class="punctuation">,</span></span><br><span class="line">    <span class="attr">&quot;info2&quot;</span><span class="punctuation">:</span> <span class="string">&quot;广州市&quot;</span><span class="punctuation">,</span></span><br><span class="line">    <span class="attr">&quot;info3&quot;</span><span class="punctuation">:</span> <span class="string">&quot;&quot;</span><span class="punctuation">,</span></span><br><span class="line">    <span class="attr">&quot;isp&quot;</span><span class="punctuation">:</span> <span class="string">&quot;基站&quot;</span></span><br><span class="line"><span class="punctuation">&#125;</span><span class="punctuation">,</span></span><br><span class="line"><span class="attr">&quot;adcode&quot;</span><span class="punctuation">:</span> <span class="punctuation">&#123;</span></span><br><span class="line">    <span class="attr">&quot;o&quot;</span><span class="punctuation">:</span> <span class="string">&quot;广东省广州市 - 基站&quot;</span><span class="punctuation">,</span></span><br><span class="line">    <span class="attr">&quot;p&quot;</span><span class="punctuation">:</span> <span class="string">&quot;广东&quot;</span><span class="punctuation">,</span></span><br><span class="line">    <span class="attr">&quot;c&quot;</span><span class="punctuation">:</span> <span class="string">&quot;广州&quot;</span><span class="punctuation">,</span></span><br><span class="line">    <span class="attr">&quot;n&quot;</span><span class="punctuation">:</span> <span class="string">&quot;广东-广州&quot;</span><span class="punctuation">,</span></span><br><span class="line">    <span class="attr">&quot;r&quot;</span><span class="punctuation">:</span> <span class="string">&quot;广东-广州&quot;</span><span class="punctuation">,</span></span><br><span class="line">    <span class="attr">&quot;a&quot;</span><span class="punctuation">:</span> <span class="string">&quot;440100&quot;</span><span class="punctuation">,</span></span><br><span class="line">    <span class="attr">&quot;i&quot;</span><span class="punctuation">:</span> <span class="literal"><span class="keyword">true</span></span></span><br><span class="line"><span class="punctuation">&#125;</span><span class="punctuation">,</span></span><br><span class="line"><span class="attr">&quot;tips&quot;</span><span class="punctuation">:</span> <span class="string">&quot;接口由VORE-API(https:\/\/api.vore.top\/)免费提供&quot;</span><span class="punctuation">,</span></span><br><span class="line"><span class="attr">&quot;time&quot;</span><span class="punctuation">:</span> <span class="number">1679909709</span></span><br><span class="line"><span class="punctuation">&#125;</span></span><br></pre></td></tr></table></figure></li>
</ul>
</li>
</ol>

      
    </div>
    
    <div class="article-info article-info-index">
      
      
      

      
      <div class="clearfix"></div>
    </div>
      
    
  </div>
  
</article>







  
    <article id="post-hello-world" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/boz/2023/03/27/hello-world/" class="article-date">
  	<time datetime="2023-03-27T08:31:20.447Z" itemprop="datePublished">2023-03-27</time>
</a>
    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy" />
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/boz/2023/03/27/hello-world/">
        Hello World
        
      </a>
    </h1>
  

      </header>
      
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>Welcome to <a target="_blank" rel="noopener" href="https://hexo.io/">Hexo</a>! This is your very first post. Check <a target="_blank" rel="noopener" href="https://hexo.io/docs/">documentation</a> for more info. If you get any problems when using Hexo, you can find the answer in <a target="_blank" rel="noopener" href="https://hexo.io/docs/troubleshooting.html">troubleshooting</a> or you can ask me on <a target="_blank" rel="noopener" href="https://github.com/hexojs/hexo/issues">GitHub</a>.</p>
<h2 id="Quick-Start"><a href="#Quick-Start" class="headerlink" title="Quick Start"></a>Quick Start</h2><h3 id="Create-a-new-post"><a href="#Create-a-new-post" class="headerlink" title="Create a new post"></a>Create a new post</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo new <span class="string">&quot;My New Post&quot;</span></span><br></pre></td></tr></table></figure>

<p>More info: <a target="_blank" rel="noopener" href="https://hexo.io/docs/writing.html">Writing</a></p>
<h3 id="Run-server"><a href="#Run-server" class="headerlink" title="Run server"></a>Run server</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo server</span><br></pre></td></tr></table></figure>

<p>More info: <a target="_blank" rel="noopener" href="https://hexo.io/docs/server.html">Server</a></p>
<h3 id="Generate-static-files"><a href="#Generate-static-files" class="headerlink" title="Generate static files"></a>Generate static files</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo generate</span><br></pre></td></tr></table></figure>

<p>More info: <a target="_blank" rel="noopener" href="https://hexo.io/docs/generating.html">Generating</a></p>
<h3 id="Deploy-to-remote-sites"><a href="#Deploy-to-remote-sites" class="headerlink" title="Deploy to remote sites"></a>Deploy to remote sites</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo deploy</span><br></pre></td></tr></table></figure>

<p>More info: <a target="_blank" rel="noopener" href="https://hexo.io/docs/one-command-deployment.html">Deployment</a></p>

      
    </div>
    
    <div class="article-info article-info-index">
      
      
      

      
      <div class="clearfix"></div>
    </div>
      
    
  </div>
  
</article>







  
  
</div>
      <footer id="footer">
  <div class="outer">
    <div id="footer-info">
      <div class="footer-left">
        &copy; 2023 boz03
      </div>
        <div class="footer-right">
          <a href="http://hexo.io/" target="_blank">Hexo</a>  Theme <a href="https://github.com/preccrep/hexo-theme-jelly" target="_blank">Jelly</a>
        </div>
    </div>
  </div>
</footer>
    </div>
    
  
<link rel="stylesheet" href="/boz/fancybox/jquery.fancybox.css">



<script>
	var yiliaConfig = {
		fancybox: true,
		mathjax: false,
		animate: true,
		isHome: true,
		isPost: false,
		isArchive: false,
		isTag: false,
		isCategory: false,
		open_in_new: false
	}
</script>

<script src="/boz/js/main.js"></script>




  </div>
</body>
</html>